#include "common.h" 
#include "main.h"

int main()
{
    HTMLog * log = new HTMLog(HTM_FILE);
    log->Info("Log created - Starting programm...");

    XGame * game = new XGame(log);
    game->init();

    int done=0;

    printf("main - > XGame->init() - complete\n");
    
    while (done == 0)
    {
        SDL_Event event; 
        while ( SDL_PollEvent(&event) )
        {
            if ( event.type == SDL_QUIT )
            {
                done = 1; 
            } 
            
            if ( event.type == SDL_KEYDOWN )
            {
                if ( event.key.keysym.sym == SDLK_ESCAPE )
                {
                    done = 1; 
                } 
            } 
        }
        
    game->process();
    //SDL_Delay(100);
    }

    log->Info("Quiting SDL");
    SDL_Quit();
    log->Info("Quiting...");
    
    delete game;
    delete log;

    return 0;
}
